<?php

namespace Bliss\ParcBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Salle
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Bliss\ParcBundle\Entity\SalleRepository")
 */
class Salle
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;
    
     /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;
    
    
    /**
     *
     * @ORM\OneToMany(targetEntity="Bliss\ParcBundle\Entity\Machine", mappedBy="salle", cascade={"persist"})
     */
    private $machines; 


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
    
    
    /**
     * Set nom
     *
     * @param string $nom
     * @return Machine
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }

    
    
     public function getMachines()
    {
        return $this->machines;
    }
    
    public function addProduit(\Bliss\ParcBundle\Entity\Machine $machine)
    {
        $this->machines[] = $machine;
    }
    
    public function __toString() {
        return $this->nom;
    }
    
}
